﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PPSMS_Model
{
    /// <summary>
    /// 逆变器状态表
    /// </summary>
    public class InverterStatus
    {
        /// <summary>
        /// ID 主键自增
        /// </summary>
        public long ID { get; set; }
        /// <summary>
        /// InverterID 逆变器ID
        /// </summary>
        public long? InverterID { get; set; }
        /// <summary>
        /// Status 状态
        /// <para>
        /// 1=>正常
        /// 2=>维修
        /// 3=>停机
        /// </para>
        /// </summary>
        public string? Status { get; set; }
        /// <summary>
        /// Timestamp 时间戳
        /// </summary>
        public string? Timestamp { get; set; }
        /// <summary>
        /// ArrayVoltage 阵列电压
        /// </summary>
        public double? ArrayVoltage { get; set; }
        /// <summary>
        /// ArrayCurrent 阵列电流
        /// </summary>
        public double? ArrayCurrent { get; set; }
        /// <summary>
        /// GridVoltage 并网电压
        /// </summary>
        public double? GridVoltage { get; set; }
        /// <summary>
        /// CurrentA 交流测电流IA
        /// </summary>
        public double? CurrentA { get; set; }
        /// <summary>
        /// CurrentB 交流测电流IB
        /// </summary>
        public double? CurrentB { get; set; }
        /// <summary>
        /// CurrentC 交流测电流IC
        /// </summary>
        public double? CurrentC { get; set; }
        /// <summary>
        /// Frequency 频率
        /// </summary>
        public double? Frequency { get; set; }
        
        /// <summary>
        /// 机内温度
        /// </summary>
        public double? InternalTemperature { get; set; }
        /// <summary>
        /// CurrentPower 当前发电功率
        /// </summary>
        public double? CurrentPower { get; set; }
        /// <summary>
        /// AveragePower 平均发电功率
        /// </summary>
        public double? AveragePower { get; set; }
    }
    /*CREATE TABLE IF NOT EXISTS INVERTER_STATUS (
        ID INTEGER PRIMARY KEY AUTOINCREMENT,--ID
        INVERTERID INTEGER,--逆变器ID
        STATUS TEXT,--状态
        TIMESTAMP TEXT,--时间戳
        ARRAY_VOLTAGE REAL,--阵列电压/V 
        ARRAY_CURRENT REAL,--阵列电流/A 
        GRID_VOLTAGE REAL,--并网电压/V 
        CURRENT_A REAL,--交流测电流IA/A  
        CURRENT_B REAL,--交流测电流IB/A 
        CURRENT_C REAL,--交流测电流IC/A 
        FREQUENCY REAL,--频率/HZ 
        INTERNAL_TEMPERATURE REAL,--机内温度/℃ 
        CURRENT_POWER REAL,--当前发电功率/W 
        AVERAGE_POWER REAL--平均发电功率/W 
    );--逆变器状态表*/
}
